# Flags for C pre-processor 
AM_CPPFLAGS=-DHAVE_CONFIG_H -I.  -I/usr/local/include -I/usr/local/include/generic -I/usr/local/include/poisson
 
# Library include directory: This is where all the header files live
OOMPH-LIB_INCLUDE_DIR=/usr/local/include
 
# Library directory: This is where all of oomph-lib's sub-libraries live
OOMPH-LIB_LIB_DIR=/usr/local/lib
 
# These are the external (3rd party) libraries that are distributed
# with oomph-lib and that we always link against
OOMPH-LIB_EXTERNAL_LIBS=-loomph_hsl -loomph_superlu_3.0 -loomph_metis_4.0 -loomph_arpack -loomph_lapack -loomph_flapack -loomph_blas
 
# This is additional machine-specific linking information that 
# allows mixed-language compilation/linking
FLIBS=-L/usr/lib/openmpi/lib -L/lib -lmpi_f77 -lmpi -lopen-rte -lopen-pal -ldl -lnsl -lutil -lgfortran -lm -lquadmath -lpthread 
 
# Flags required for the use of shared libraries 
SHARED_LIBRARY_FLAGS=-Wl,--rpath -Wl,/usr/local/lib
 
#---------------------------------------------------------------
# These are the specific oomph-lib sub-libraries that we have to link against
# for this driver code -- edit this according to your requirements
# but remember that the order of the libraries matters: List the
# the more specific ones before the more general ones!
OOMPH-LIB_LIBS=-lpoisson -lgeneric

all: two_d_poisson

two_d_poisson.o: two_d_poisson.cc
	 g++ $(AM_CPPFLAGS) -c two_d_poisson.cc -o two_d_poisson.o \
	       -I$(OOMPH-LIB_INCLUDE_DIR) 
  
two_d_poisson: two_d_poisson.o
	 g++ $(SHARED_LIBRARY_FLAGS) $< -o $@ \
	       -L$(OOMPH-LIB_LIB_DIR) $(EXTERNAL_DIST_LIBRARIES) $(OOMPH-LIB_LIBS) \
	        $(OOMPH-LIB_EXTERNAL_LIBS) $(FLIBS) 


clean:
	rm -f two_d_poisson two_d_poisson.o

run: two_d_poisson
	./two_d_poisson

